package model;

import java.io.FileOutputStream;
import java.io.IOException;

public class WriteFile {
	public static void main(String[] args) throws IOException {
		
		/*mo file de ghi, neu chua co thi tao moi
		 * Neu khong co "true" thi mac dinh se ghi de len file nguoc lai se them moi
		 */
		FileOutputStream fout = new FileOutputStream("b.txt", true);
		
		try {
			int i;
			for(i = 65; i < 91; i++) {
				fout.write((char)i);
			}
		}
		catch(IOException exc) {
			System.out.print("Error occur when write to file");
		}
		
		//dua tat ca nhung gi con trong buffer vao trong file
		fout.flush();
		
		//dong stream
		fout.close();
		
	}

}
